<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0041)http://www.ewebvn.com/demo/div-three-col/ -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Wedding studio</title>
    <script type="text/javascript">
        $(document).ready(function(){
			var max_height = 0;
			//Duyet qua 3 cot de lay kich thuoc cot lon nhat
			$("#left,#center,#right").each(function(){
				if($(this).height() > max_height)
					max_height = $(this).height();
			});
			//Gan do cao 3 cot theo gia tri max_height
			$("#left,#center,#right").height(max_height);
        });
    </script> 
    
    <script>
                    function updateContact(diachi,email,dienthoai,didong,skype,yahoo,facebook)
                    {
						var stuff ={
							'diachi':diachi,
							'email':email,
							'dienthoai':dienthoai,
							'didong':didong,
							'skype':skype,
							'yahoo':yahoo,
							'facebook':facebook,
							};
						var jsonContact = JSON.stringify(stuff);
                        var xmlhttp;    
                       
                        if (window.XMLHttpRequest)
                          {// code for IE7+, Firefox, Chrome, Opera, Safari
                              xmlhttp=new XMLHttpRequest();
                          }
                        else
                        {// code for IE6, IE5
                              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                        }
                        xmlhttp.onreadystatechange=function(e)
                        {
                              if (xmlhttp.readyState==4 && xmlhttp.status==200)
                              {
                                var response = xmlhttp.responseText;
								if(response == 1){
									alert("Cập nhật thành công!");
								}
								window.location.replace("../administrator/lienhe_admin.php");
                              }
                        }
                            xmlhttp.open("GET","xuly_lienhe_admin.php?value="+jsonContact ,true);
                            xmlhttp.send();
                    
                    }
					
					
					
					function updateInfo(linkvideo, thongtin)
                    {
						var infomat = [];
						infomat[0] = thongtin;
						var stuff ={
							'linkvideo':linkvideo,
							'thongtin':infomat,
							};
						var jsonInfo = JSON.stringify(stuff);
                        var xmlhttp;    
                       
                        if (window.XMLHttpRequest)
                          {// code for IE7+, Firefox, Chrome, Opera, Safari
                              xmlhttp=new XMLHttpRequest();
                          }
                        else
                        {// code for IE6, IE5
                              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                        }
                        xmlhttp.onreadystatechange=function(e)
                        {
                              if (xmlhttp.readyState==4 && xmlhttp.status==200)
                              {
                                var response = xmlhttp.responseText;
								if(response == 1){
									alert("Cập nhật thành công!");
								}
								window.location.replace("../administrator/lienhe_admin.php");
                              }
                        }
                            xmlhttp.open("GET","xuly_gioithieu_admin.php?value="+jsonInfo ,true);
                            xmlhttp.send();
                    
                    }
					
					
                    </script>   

</head>
<body>
<?php include("../administrator/header_admin.php");
		include ("../administrator/load_lienhe.php");
		
		if(isset($_POST['capnhat'])){
			echo "<script type=\"text/javascript\">
                updateContact('".$_POST['diachi']."','".$_POST['email']."','".$_POST['dienthoai']."','".$_POST['didong']."',						'".$_POST['skype']."','".$_POST['yahoo']."','".$_POST['facebook']."');
                </script>";
		}
		
		if(isset($_POST['capnhat_gioithieu'])){
			echo "<script type=\"text/javascript\">
				updateInfo('".$_POST['linkvideo']."','".$_POST['thongtin']."');
                </script>";
		}
?>
    <div id="mainWap">
    	<h3 style="text-align:center">Cập Nhật Thông Tin Liên Hệ</h3>
        <div id="left_intro">
       
        <form action="" method="post">
            <table border="0" align="left" cellpadding="0" cellspacing="8"> 
            <tr><td><b>Địa chỉ:</b></td><td><input name="diachi" type="text" id="diachi" 
            value="<?php 
				if(isset($_POST['diachi'])){
					echo $_POST['diachi'];
				}
					else{echo $result_diachi[0];
				}?>"></td></tr>
            <tr><td><b>Email:</b></td><td><input name="email" type="text" id="email"
             value="<?php 
				if(isset($_POST['email'])){
					echo $_POST['email'];
				}
					else{echo $result_email[0];
				}?>"></td></tr>
            <tr><td><b>Điện thoại:</b></td><td><input name="dienthoai" type="text" id="dienthoai" 
            value="<?php
			 if(isset($_POST['dienthoai'])){
					echo $_POST['dienthoai'];
				}
					else{echo $result_dienthoai[0];
				}?>"></td></tr>
            <tr><td><b>Di động:</b></td><td><input name="didong" type="text" id="didong" 
            value="<?php
			 if(isset($_POST['didong'])){
					echo $_POST['didong'];
				}
					else{echo $result_didong[0];
				}?>"></td></tr>
            <tr><td><b>Skype:</b></td><td><input name="skype" type="text" id="skype"
             value="<?php
			  if(isset($_POST['skype'])){
					echo $_POST['skype'];
				}
					else{echo $result_skype[0];
				} ?>"></td></tr>
            <tr><td><b>Yahoo:</b></td><td><input name="yahoo" type="text" id="yahoo" 
            value="<?php
			 if(isset($_POST['yahoo'])){
					echo $_POST['yahoo'];
				}
					else{echo $result_yahoo[0];
				}?>"></td></tr>
            <tr><td><b>Facebook:</b></td><td><input name="facebook" type="text" id="facebook"
             value="<?php
			  if(isset($_POST['facebook'])){
					echo $_POST['facebook'];
				}
					else{echo $result_facebook[0];
				} ?>"></td></tr>
             <tr><td></td><td><input name="capnhat" id="capnhat" type="submit" value="Cập Nhật">&nbsp;&nbsp;
             					<input name="huy" type="reset" value="Hủy"></td></tr>
            </table>
        </form>
		</div>
        <div id="right_intro">
        <table  border="1" align="center" cellpadding="0" width="730" height="400">
        <form action="" method="post">
        <tr height="30">
        <td align="center" width="350">Link video cần hiển thị <textarea style="width:720px; height:100px" name="linkvideo" id="linkvideo"><?php
			 if(isset($_POST['linkvideo'])){
					echo $_POST['linkvideo'];
				}
					else{echo $result_gioithieu['linkvideo'];
				}?></textarea></td>
        </tr>
        <tr>
        <td>
            <textarea style="width:720px; height:300px" name="thongtin" id="thongtin" ><?php
			 if(isset($_POST['thongtin'])){
					echo $_POST['thongtin'];
				}
					else{echo $result_gioithieu['thongtin'];
				}?></textarea>
            <input type="submit" name="capnhat_gioithieu" id="capnhat_gioithieu" value="Cật Nhật" />&nbsp;&nbsp;
            <input name="huy" type="reset" value="Hủy"></td></tr>
        </td>
        </tr>
         </form>
        </table>
        </div>
        <div class="clr"></div>
    </div>
         <?php include("../administrator/footer_admin.php"); ?>
    <!-- end wapper -->

<div style="display:none" id="addthis-extension-script"></div></body><div style="display: none; " id="k1XKb07LtFf3qXDHOv7u5v1C" class="kzlzuwUwKPAvDYR3E7uqB8"></div><div style="display: none; " id="YV8CLCODDDq0pfWQ4qijEZEt_" class="kzlzuwUwKPAvDYR3E7uqB8"></div><div style="display: none; " id="kWRY8_3uCTQWbN_sjCoSQjlEqp" class="kzlzuwUwKPAvDYR3E7uqB8"></div></html>